﻿<UserControl x:Class="Brjnk.GpxExplorer.UI.GeoObjectsPicker"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:common="clr-namespace:Brjnk.Common;assembly=Common"
             DataContext="{Binding RelativeSource={RelativeSource Mode=Self}}">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition></RowDefinition>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition></RowDefinition>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition ></RowDefinition>
            <RowDefinition Height="Auto"></RowDefinition>
        </Grid.RowDefinitions>

        <TextBlock Style="{StaticResource ResourceKey=HeaderStyle}" Text="Body" Grid.Row="0" />

        <ListView Grid.Row="1" ItemsSource="{Binding Waypoints}">
            <ListView.ItemTemplate>
                <DataTemplate>
                    <CheckBox IsChecked="{Binding Path=IsChecked}" Content="{Binding Path=Object}" ContentTemplate="{StaticResource WaypointImportTemplate}"
                              TextBlock.Foreground="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ListViewItem}, Path=(TextBlock.Foreground)}" />
                </DataTemplate>
            </ListView.ItemTemplate>
        </ListView>

        <StackPanel Orientation="Horizontal" Grid.Row="2">
            <Button Name="wpAll" Click="wpAll_Click">Vybrat vše</Button>
            <Button Name="wpNothing" Click="wpNothing_Click">Nevybrat nic</Button>
            <Button Name="gcAll" Click="gcAll_Click">Vybrat všechny GC</Button>
            <Button Name="gcNothing" Click="gcNothing_Click">Nevybrat žádné GC</Button>
        </StackPanel>

        <TextBlock Style="{StaticResource ResourceKey=HeaderStyle}" Text="Trasy" Grid.Row="3" />

        <ListView Grid.Row="4" ItemsSource="{Binding Routes}">
            <ListView.ItemTemplate>
                <DataTemplate>
                    <CheckBox IsChecked="{Binding Path=IsChecked}" Content="{Binding Path=Object}" ContentTemplate="{StaticResource RouteImportTemplate}"
                              TextBlock.Foreground="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ListViewItem}, Path=(TextBlock.Foreground)}" />
                </DataTemplate>
            </ListView.ItemTemplate>
        </ListView>

        <StackPanel Orientation="Horizontal" Grid.Row="5">
            <Button Name="rAll" Click="rAll_Click">Vybrat vše</Button>
            <Button Name="rNothing" Click="rNothing_Click">Nevybrat nic</Button>
        </StackPanel>

        <TextBlock Style="{StaticResource ResourceKey=HeaderStyle}" Text="Stopy" Grid.Row="6" />

        <ListView Grid.Row="7" ItemsSource="{Binding Tracks}">
            <ListView.ItemTemplate>
                <DataTemplate>
                    <CheckBox IsChecked="{Binding Path=IsChecked}" Content="{Binding Path=Object}" ContentTemplate="{StaticResource TrackImportTemplate}"
                              TextBlock.Foreground="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ListViewItem}, Path=(TextBlock.Foreground)}" />
                </DataTemplate>
            </ListView.ItemTemplate>
        </ListView>

        <StackPanel Orientation="Horizontal" Grid.Row="8">
            <Button Name="tAll" Click="tAll_Click">Vybrat vše</Button>
            <Button Name="tNothing" Click="tNothing_Click">Nevybrat nic</Button>
        </StackPanel>
    </Grid>
</UserControl>